#!/usr/bin/make -f

export DEB_CPPFLAGS_MAINT_APPEND = -DNDEBUG
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
		-DSYSCONFDIR=/etc \
		-DLOCALSTATEDIR=/var \
		-DLIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
		-DBUILD_WITH_LDAP=ON \
		-DBUILD_WITH_RADIUS=no \
		$(NULL)

# we also want to build the doxygen documentation
override_dh_auto_build:
	dh_auto_build
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	dh_auto_build -- doc
endif

override_dh_missing:
	dh_missing --fail-missing
